package main

import (
	"fmt"
)

func main() {
	var myMap11 map[string]string
	if myMap11 == nil {
		fmt.Println("myMap11 是空 ")
	}

	var myMap1 map[string]string

	if myMap1 == nil {
		fmt.Println("myM ap1 is nil..")
	}
	// 开辟空间
	myMap1 = make(map[string]string, 10)
	// 赋值
	myMap1["one"] = "java"
	myMap1["two"] = "python"
	myMap1["three"] = "Go"
	fmt.Println(myMap1)
	m := make(map[string]string, 20)
	m["1"] = "10"
	m["2"] = "20"
	m["3"] = "30"
	m["4"] = "40"
	fmt.Println(m)

	fmt.Println("=========第二种声明方式 myMap2 ==========")
	myMap2 := make(map[int]string)
	myMap2[1] = "go"
	myMap2[2] = "c++"
	myMap2[3] = "rust"
	fmt.Println(myMap2)

	fmt.Println("=========第三种声明方式==========")
	myMap3 := map[string]string{
		"one":   "go",
		"two":   "c++",
		"three": "ruby",
	}
	fmt.Println(myMap3)

}
